<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
 <a href="../files/2021-06-08-08.docx" download="2021-06-08-08.docx">点击下载</a>
<button type="button"  onclick="download()">导出</button>

  function download() {

    var a = document.createElement('a');

    var url = 'download/?filename=aaa.txt';

    var filename = 'data.xlsx';


    a.href=url;

    a.download = filename;

    a.click()

 }
</body>
</html>